#ifndef __WORKCANVAS_H__
#define __WORKCANVAS_H__

#include <standard/delegate.h>
#include <standard/gui.h>
#include <standard/hotkey.h>

class CTextureTarget;
class CEditorSceneMgr;
class CXML;
class CWorkCanvas: public IDelegateInterface, public CTranslatePanel, public CUIEvent, public CHotKeyEvent{
public:
    CWorkCanvas( float fLeft, float fTop, float fWidth, float fHeight );
    virtual ~CWorkCanvas();
    virtual void OnClick( CUIElement *pSelf );
    virtual void OnMouseEvent( CUIElement *pSelf, EUIMouseMessage eMouseMessage, int32 x, int32 y, int32 z, int32 s );
    virtual void OnKeyEvent( CUIElement *pSelf, EUIKeyMessage eKeyMessage, int32 nKey );
    virtual void OnHotKey( int32 nID );
    void Init();
    void Final();
    void ReleaseMap();
    bool32 NewMap( const char* strResourceSpace, int32 nBlockCountX, int32 nBlockCountY, float fBlockSize, float fObjectUnitSize, const char* strSkyBox );
    bool32 OpenMap( CXML *pXML );
    bool32 SaveMap( const char* strFileName );
    int32 Update( int32 nDelta, float fDelta );
    int32 Render();
    CEditorSceneMgr* GetSceneMgr(){ return m_rSceneMgr.GetEntityData(); }

private:
    void OnNotification_SetOperatorType( int32 w, int32 l, void* pData );
    void OnNotification_SetCommandType( int32 w, int32 l, void* pData );
    void OnNotification_SetSceneVisible( int32 w, int32 l, void* pData );

    float m_fCanvasWidth, m_fCanvasHeight;
    Ref<CTextureTarget*> m_rTextureTarget;
    bool32 m_bCtrlDown;
    bool32 m_bShiftDown;
    Ref<CEditorSceneMgr*> m_rSceneMgr;

};



#endif
